package com.ponhu.ea2.dto;

import com.ponhu.ea2.support.validation.annotions.ValidateEnumValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 * 云商第二个版本DTO
 * @author Wang
 * @date 2021/11/18 5:12 下午
 */
@ApiModel("云商商品数据V2DTO")
@Data
@Accessors(chain = true)
public class CloudTradeGoodsV2Dto implements Serializable {
    private static final long serialVersionUID = 8828095445770767026L;

    @NotEmpty(message = "渠道商品编码不能为空")
    @ApiModelProperty(value = "渠道商品编码=货品编码", required = true)
    private String channelGoodsCode;

    @NotEmpty(message = "商品名称不能为空")
    @ApiModelProperty(value = "商品名称", required = true)
    private String goodsName;

    @NotEmpty(message = "货品主图不能为空")
    @ApiModelProperty(value = "货品主图", required = true)
    private String mainImage;

    @NotEmpty(message = "货品细节图不能为空")
    @ApiModelProperty("货品细节图")
    private List<@NotEmpty String> detailImages;

    @ApiModelProperty("入库价格")
    private BigDecimal inPrice;

    @ApiModelProperty("建议售价")
    private BigDecimal advicePrice;

    @ApiModelProperty("采购价")
    private BigDecimal purchasePrice;

    @ApiModelProperty("市场价格")
    private BigDecimal marketPrice;

    @ApiModelProperty("供货价")
    private BigDecimal supplyPrice;

    @NotNull(message = "成色ID不能为空")
    @ApiModelProperty(value = "成色", required = true)
    private Integer quality;

    @ApiModelProperty("备注")
    private String remarks;

    @NotNull(message = "入库方式ID不能为空")
    @ApiModelProperty(value = "入库方式", required = true)
    private Integer inWay;

    @NotNull(message = "店铺ID不能为空")
    @ApiModelProperty(value = "店铺ID", required = true)
    private Integer accountId;

    @ApiModelProperty("瑕疵")
    private String flaw;

    @ApiModelProperty("原产地")
    private String provenance;

    @ApiModelProperty(value = "货品附件集合")
    private List<String> annexList;

    @ApiModelProperty(value = "货品配件集合")
    private List<String> accessoryList;

    @Valid
    @ApiModelProperty(value = "货品属性集合")
    private List<CloudTradePropertyDto> propertyList;

    @NotEmpty(message = "来源渠道不能为空")
    @ApiModelProperty(value = "来源渠道(1级采购渠道名称+2级采购渠道名称)")
    private String sourceChannel;

    @NotNull(message = "一级采购渠道ID不能为空")
    @ApiModelProperty(value = "一级采购渠道ID")
    private Integer firstPurchaseChannel;

    @NotNull(message = "二级采购渠道ID不能为空")
    @ApiModelProperty(value = "二级采购渠道ID")
    private Integer secondPurchaseChannel;

    @NotNull(message = "货主ID不能为空")
    @ApiModelProperty(value = "货主ID")
    private Long inventoryOwner;

    @NotNull(message = "销售模式不能为空")
    @ValidateEnumValue(intValues = {1,2}, message = "销售模式必须为1或2")
    @ApiModelProperty(value = "销售模式(1以采定销;2以销定采)")
    private Integer salesModel;

    @ApiModelProperty(value = "三级品类ID")
    private Long categoryId;

    @ApiModelProperty(value = "品牌ID")
    private Long brandId;

    @ApiModelProperty(value = "适用人群")
    private Integer applyCrowd;

    @ApiModelProperty(value = "商品年份")
    private String goodsYear;
}


